//
//  BaseViewController.m
//  ZLShang
//
//  Created by wangguangming on 15/7/24.
//  Copyright © 2015年 Amber. All rights reserved.
//

#import "BaseViewController.h"

@implementation BaseViewController
-(NSArray *)setTypeNSString:(NSString *)tpstring
{
    if ([tpstring isEqualToString:@"closed"]) 
        {
        return @[@"关闭"];
        }
    else if ([tpstring isEqualToString:@"succeed"]) 
        {
        return @[@"成功"];
        }
    else if ([tpstring isEqualToString:@"stockout"]) 
        {
        return @[@"库存不足"];
        }
    
    else if ([tpstring isEqualToString:@"problem"]) 
        {
        return @[@"失联",@"少配",@"货损"];
        }
    
    else if ([tpstring isEqualToString:@"timeout"]) 
        {
        return @[@"关闭"];
        }
    
    else if ([tpstring isEqualToString:@"succeed"]) 
        {
        return @[@"成功"];
        }
    
    else if([tpstring isEqualToString:@"generated"])
        {
        return @[@"发货"];
        }
    else{
        
        return @[@"不详"];
    }
    
}
-(NSString *)setrole:(int)intvalu
{
    if (intvalu==1)
        {
        return @"超级管理员";
        }
    if (intvalu==2)
        {
        return @"配送管理员";
        }
    if (intvalu==3)
        {
        return @"送货人员";
        }
    if (intvalu==4)
        {
        return @" 配货人员";
        }
    if (intvalu==5)
        {
        return @"配送人员";
        }
    else
        {
        return @"";
        }
    
}
-(NSString *)setOrderType:(int )inter
{
    if (inter==0)
        {
        return @"成功";
      }
   else if (inter==1)
        {
        return @"已取消";
       }
       else if(inter==3)
        {
        return @"已发货";
        
        }
       else if(inter==5)
        {
        return @"被拒收";
        }
    else if(inter==6)
        {
        return @"失联";
        }
    else if(inter==7)
        {
        return @"补货";
        }
    else if(inter==8)
        {
        return @"二手商品已封存";
        }
    else if(inter==9)
        {
        return @"未发货";
        }
    else
        {
        return @"不详";
        }
}
-(NSString *)setOrderType:(int )inter backorder:(int )intvalue
{
    if (inter==0)
        {
        return @"成功";
        }
    else if (inter==1)
        {
        return @"已取消";
        }
    else if(inter==3)
        {
        return @"已发货";
        
        }
    else if(inter==5)
        {
        return @"被拒收";
        }
    else if(inter==6)
        {
        return @"失联";
        }
    else if(inter==7)
        {
        return @"补货";
        }
    else if(inter==8)
        {
        return @"二手商品已封存";
        }
    else if(inter==9&&intvalue==0)
        {
        return @"未发货";
        }
    else if(inter==9&&intvalue==1)
        {
        return @"补货,未发货";
        }
    else
        {
        return @"不详";
        }
 
}
-(void)setBack
{
    
    self.view.userInteractionEnabled=YES;
    UIBarButtonItem *left=[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(turenAction)];
    self.navigationItem.leftBarButtonItem=left;
}
-(void)turenAction
{
    [self.navigationController popViewControllerAnimated:YES];
}
@end
